package com.gjy.spring.service;

import com.gjy.spring.aspect.Timeout;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-02-17 16:38:47
 */
@Service
public class AsyncService {

    @Timeout(timeout = 3000)
    public String hello2(Long time) {
        try {
            TimeUnit.SECONDS.sleep(time);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return "hello2";
    }

}
